package com.itlong.cloud.smartcard.resource;

import com.itlong.cloud.POJO.DTO.smartcard.SmartCardOldGetProjectPageDTO;
import com.itlong.cloud.POJO.DTO.smartcard.SmartCardOldProjectInfoDTO;
import com.itlong.cloud.POJO.DTO.smartcard.SmartCardOldUpdateProjectDTO;
import com.itlong.cloud.POJO.VO.smartcard.SmartCardOldProjectInfoPageVO;
import com.itlong.cloud.smartcard.service.ISmartCardOldProjectService;
import com.itlong.cloud.user.smartcard.ISmartCardOldProjectServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      旧一卡通_项目模块暴露接口实现类。
 * <desc/>
 *
 * @createDate 2017/11/2.
 */
@RestController
public class SmartCardOldProjectServiceResource  implements ISmartCardOldProjectServiceClient {

    @Autowired
    ISmartCardOldProjectService iSmartCardOldProjectService;
    /**
     * <desc>
     *      旧一卡通_增加项目信息。
     * <desc/>
     *
     * @param saveDTO 保存参数
     * @return
     * @author shengen.T
     * @createDate 2017/11/20
     */
    @Override
    @RequestMapping(path = "/bas/projectInfo/manage/add")
    public Integer addProjectInfo(@RequestBody SmartCardOldProjectInfoDTO saveDTO) throws Exception{
        return iSmartCardOldProjectService.addProjectInfo(saveDTO);
    }

    /**
     * <desc>
     *      获取项目信息分页列表。
     * <desc/>
     *
     * @param pageDTO 请求参数
     * @return
     * @author shengen.T
     * @createDate 2017/11/21
     */
    @Override
    @RequestMapping(path = "/bas/projectInfo/manage/list")
    public Page<SmartCardOldProjectInfoPageVO> getProjectInfoPage(@RequestBody SmartCardOldGetProjectPageDTO pageDTO) throws Exception{
        return iSmartCardOldProjectService.getProjectInfoPage(pageDTO);
    }

    /**
     * <desc>
     *      更新项目。
     * <desc/>
     *
     * @param  updateProjectDTO
     * @return 返回影响行数
     * @author shengen.T
     * @createDate 2017/11/22
     */
    @Override
    @RequestMapping(path = "/bas/projectInfo/manage/update")
    public Integer updateProject(@RequestBody SmartCardOldUpdateProjectDTO updateProjectDTO) throws Exception{
        return iSmartCardOldProjectService.updateProjectInfo(updateProjectDTO);
    }


}
